import request from "@/utils/request.js";
//获取所有项目
export function getAllItem(query){
    return request({
        url:'/experiment/out/item/list',
        method:'get',
        params:query
    })
}
//获取当前项目所有样品
export function listSample(query){
    return request({
        url:'/experiment/out/sample/list',
        method:'get',
        params:query
    })
}

// 查询实验管理列表
export function listDetail(query) {
    return request({
        url: '/experiment/out/list',
        method: 'get',
        params: query
    })
}
// 查询实验管理详细
export function getDetail(experimentId) {
    return request({
        url: '/experiment/out/' + experimentId,
        method: 'get'
    })
}

// 修改实验管理
export function updateDetail(data) {
    return request({
        url: '/experiment/out',
        method: 'put',
        data: data
    })
}
export function setPosts(data) {
    return request({
        url: '/experiment/out/posts',
        method: 'put',
        data: data
    })
}
export function cancelPost(id){
    return request({
        url:'/experiment/out/cancel?id='+id,
        method:'get'
    })
}
// 查询岗位类型列表
export function listJob(typeId) {
    return request({
        url: '/experiment/out/job/list?typeId='+typeId,
        method: 'get'
    })
}
//流转消息
export function postFlume(data){
    return request({
        url:'/experiment/out/flume',
        method:'post',
        data:data
    })
}
/** 邮寄业务  */
// 查询样品邮寄列表
export function listMailing(query) {
    return request({
        url: '/experiment/mail/list',
        method: 'get',
        params: query
    })
}

// 查询样品邮寄详细
export function getMailing(mailingId) {
    return request({
        url: '/experiment/mail/' + mailingId,
        method: 'get'
    })
}

// 新增样品邮寄
export function addMailing(data) {
    return request({
        url: '/experiment/mail',
        method: 'post',
        data: data
    })
}
// 批量新增样品邮寄
export function addMailings(data) {
    return request({
        url: '/experiment/mail/adds',
        method: 'post',
        data: data
    })
}
// 修改样品邮寄
export function updateMailing(data) {
    return request({
        url: '/experiment/mail',
        method: 'put',
        data: data
    })
}

// 删除样品邮寄
export function delMailing(mailingId) {
    return request({
        url: '/experiment/mail/' + mailingId,
        method: 'delete'
    })
}

//获取未流转实验分发人的实验
export function getNoFlumeJobs(ids){
    return request({
        url:'experiment/out/getNoFlumeJobs',
        method:'post',
        data:ids,
    })
}

//获取样品对应的实验
export function getExperimentBySampleId(id){
    return request({
        url:'/experiment/out/getexp?id='+id,
        method:'get'
    })
}

export function finishExpe(id,out){
    return request({
        url:'/experiment/out/finish/out?id='+id+'&out='+out,
        method:'get'
    })
}

//获取制备样品列表
export function getSampleTree(itemId){
    return request({
        url:'/experiment/out/make/list?itemId='+itemId,
        method:'get'
    })
}
//制备样品
export function makeSample(sample){
    return request({
        url:'/experiment/out/make',
        method:'post',
        data:sample
    })
}
//删除图片
export function deleteImg(filename){
    return request({
        url:'/common/download?fileName='+filename+'&delete=true',
        method:'get'
    })
}
//归还样品
export function backSample(ids){
    return request({
        url:'/experiment/out/back?ids='+ids,
        method:'get'
    })
}
//查询样品下的实验是否完成
export function isFinish(id){
    return request({
        url:'/experiment/out/isFinish?id='+id,
        method:'get'
    })
}
